﻿using System;
using System.Text;
using PEMath;

namespace Example
{
    class Program
    {
        
        static void Main(string[] args)
        {
            PEArgs a =PEArgs.HALFPI;
            a.ConvertViewAngle();

            PEInt p = new PEInt(2.5f);
            PEInt p2 = (PEInt) 2.5;

            /*MyClass c = new MyClass();
            var cc = c.v;
            var x= cc.x;
            
            MyClass c2 = new MyClass();
            var xx = c2.v.x;*/ //测试IL码 这两种得到方式的区别，第一种把v的值加载到栈中，第二种会把v的地址加载到栈中
        }

        static void Example2() {
            PEVector3 v = new PEVector3(2, 2, 2);
            Console.WriteLine(v.magnitude);
            Console.WriteLine("-------");

            PEInt val = 3;

            Console.WriteLine(PECalc.Sqrt(val));
        }

        static void Example1() {
            PEInt val1 = new PEInt(1);
            PEInt val2 = new PEInt(0.5f);

            if(val1 > val2) {
                Console.WriteLine(true);
            }
            else {
                Console.WriteLine(false);
            }

            PEInt val3 = val1 << 1;
            Console.WriteLine(val3.ToString());

            PEInt val4 = 10;
            PEInt val5 = (PEInt)0.3f;
 
            var pe = val5*500;
            Console.WriteLine(pe.ScaledValue);
            Console.WriteLine(pe.RawFloat);
            Console.WriteLine(pe.RawInt);
            
            val5 = (PEInt)(-0.3f);
            pe = val5*500;
            Console.WriteLine(pe.ScaledValue);
            Console.WriteLine(pe.RawFloat);
            Console.WriteLine(pe.RawInt);
            
        }
    }


    class MyClass
    {
        public PEVector3 v = PEVector3.back;
    }
}